using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using BusinessLayer;
using utilities;

public partial class grocery_DefGrocList : System.Web.UI.Page
{
    BL_UPC upcBL = new BL_UPC();
    protected void Page_Load(object sender, EventArgs e)
    {
        /*lstGroceryList.DataSource = upcBL.PopulateItemGroup();
        lstGroceryList.DataBind();*/
        
        lblReportOutput.Text = upcBL.GenerateGroceryList("html");
    }
    protected void lstGroceryList_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
       /* DataRowView dv = e.Item.DataItem as DataRowView; 
        if (dv != null)
        {
            Repeater nestedRepeater = e.Item.FindControl("lstGroceries") as Repeater; 
            if (nestedRepeater != null) 
            {
                nestedRepeater.DataSource = upcBL.PopulateDefaultGroceryList(Convert.ToInt32(dv.Row.ItemArray[0].ToString()));
                nestedRepeater.DataBind(); 
            } 
        }*/
    }
    protected void btnPrint_Click(object sender, EventArgs e)
    {

    }
    protected void btnEmail_Click(object sender, EventArgs e)
    {
        email Mail = new email();
        string output = upcBL.GenerateGroceryList("plainText");

        int status = Mail.sendMail("sd.burns@gmail.com", "sburns@netjets.com", "", "TEST EMAIL", output, "sburns@netjets.com", "127.0.0.1");
        if (status != 1)
        {
            output = "error!";
        }
    }
}
